package com.hevery.security.core.validate.code;

import org.springframework.web.context.request.ServletWebRequest;

/**
 * @author: zhy
 * @description:
 * @date: created on 2017/11/4
 * @modified by:
 */
public interface ValidateCodeProcessor {

    /**
     * 验证码放入session时的前缀
     */
    String SESSION_KEY_PREFIX = "SESSION_KEY_FOR_CODE_";

    /**
     * 创建验证码
     *
     * @param request ServletWebRequest是Spring的一个工具类，封装请求和响应
     * @throws Exception
     */
    void create(ServletWebRequest request) throws Exception;

    /**
     * 校验验证码
     *
     * @param servletWebRequest
     */
    void validate(ServletWebRequest servletWebRequest);
}
